﻿using System;
using UnityEngine;
namespace MessageBoxNS
{
    public class OverTimeMessageBoxCallBack : MonoBehaviour
    {
        public Action DestroyCallBack;
        public float timer;
        private void Start()
        {
            Invoke("ExecuteCallBack", timer);
        }
        private void ExecuteCallBack()
        {
            if (DestroyCallBack != null)
            {
                DestroyCallBack();
            }
            Destroy(this.gameObject);
        }
    }
}
